VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmDG 
   BackColor       =   &H00FFFFFF&
   Caption         =   "Dangerous Goods"
   ClientHeight    =   7740
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   9660
   Icon            =   "frmDG.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   7740
   ScaleWidth      =   9660
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton cmdCancel 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "&Cancel"
      Height          =   315
      Left            =   3525
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   21
      Top             =   7320
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton cmdSave 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "&Save/Exit"
      Height          =   315
      Left            =   1755
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   20
      Top             =   7335
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00FFFFFF&
      Caption         =   "Dangerous Goods"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000080FF&
      Height          =   7215
      Left            =   135
      TabIndex        =   22
      Top             =   0
      Width           =   9420
      Begin VB.TextBox f492 
         Height          =   315
         Left            =   6600
         TabIndex        =   9
         Top             =   2400
         Width           =   2400
      End
      Begin VB.ListBox listDG 
         Height          =   645
         Left            =   6435
         TabIndex        =   40
         Top             =   6030
         Visible         =   0   'False
         Width           =   2580
      End
      Begin VB.TextBox f461 
         Height          =   315
         Left            =   6615
         TabIndex        =   13
         Top             =   3780
         Width           =   2400
      End
      Begin VB.TextBox f476 
         Height          =   315
         Left            =   6615
         TabIndex        =   12
         Top             =   3465
         Width           =   2400
      End
      Begin VB.TextBox f489 
         Height          =   315
         Left            =   6600
         TabIndex        =   10
         Top             =   2760
         Width           =   2400
      End
      Begin VB.TextBox f1903 
         Height          =   315
         Left            =   6615
         TabIndex        =   8
         Top             =   2040
         Width           =   2400
      End
      Begin VB.ComboBox f488 
         Height          =   315
         ItemData        =   "frmDG.frx":030A
         Left            =   6615
         List            =   "frmDG.frx":0314
         TabIndex        =   11
         Top             =   3150
         Width           =   870
      End
      Begin VB.TextBox f471 
         Height          =   315
         Left            =   6615
         TabIndex        =   14
         Top             =   4140
         Width           =   2400
      End
      Begin VB.CommandButton cmdRemove 
         Appearance      =   0  'Flat
         BackColor       =   &H00E0E0E0&
         Caption         =   "Remove"
         Height          =   315
         Left            =   7740
         MaskColor       =   &H0080C0FF&
         Style           =   1  'Graphical
         TabIndex        =   19
         TabStop         =   0   'False
         Top             =   5670
         UseMaskColor    =   -1  'True
         Visible         =   0   'False
         Width           =   1215
      End
      Begin VB.CommandButton cmdAdd 
         Appearance      =   0  'Flat
         BackColor       =   &H00E0E0E0&
         Caption         =   "Add"
         Height          =   315
         Left            =   6435
         MaskColor       =   &H0080C0FF&
         Style           =   1  'Graphical
         TabIndex        =   18
         Top             =   5670
         UseMaskColor    =   -1  'True
         Visible         =   0   'False
         Width           =   1215
      End
      Begin VB.TextBox f456 
         Height          =   315
         Left            =   7785
         TabIndex        =   17
         Top             =   5175
         Width           =   1200
      End
      Begin VB.TextBox f485 
         Height          =   315
         Left            =   2160
         TabIndex        =   6
         Top             =   3240
         Width           =   2400
      End
      Begin VB.TextBox f484 
         Height          =   315
         Left            =   2160
         TabIndex        =   5
         Top             =   2925
         Width           =   2400
      End
      Begin VB.TextBox f466 
         Height          =   315
         Left            =   7785
         TabIndex        =   16
         Top             =   4860
         Width           =   1200
      End
      Begin VB.ComboBox f451 
         Height          =   315
         ItemData        =   "frmDG.frx":031E
         Left            =   2160
         List            =   "frmDG.frx":032B
         TabIndex        =   7
         Top             =   4455
         Width           =   2400
      End
      Begin VB.TextBox f1932 
         Height          =   315
         Left            =   7785
         TabIndex        =   15
         Top             =   4500
         Width           =   1200
      End
      Begin VB.TextBox f1922 
         Height          =   315
         Left            =   2160
         TabIndex        =   4
         Top             =   2610
         Width           =   2400
      End
      Begin VB.TextBox f1493 
         Height          =   315
         Left            =   4500
         TabIndex        =   2
         Text            =   "N"
         Top             =   1755
         Width           =   660
      End
      Begin VB.TextBox f1918 
         Height          =   315
         Left            =   2160
         TabIndex        =   3
         Top             =   2295
         Width           =   2400
      End
      Begin VB.OptionButton optIDG 
         BackColor       =   &H00FFFFFF&
         Caption         =   "Inaccessible"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   1800
         TabIndex        =   1
         Top             =   1800
         Width           =   1455
      End
      Begin VB.OptionButton optADG 
         BackColor       =   &H00FFFFFF&
         Caption         =   "Accessible"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   315
         Left            =   270
         TabIndex        =   0
         Top             =   1800
         Width           =   1410
      End
      Begin VB.TextBox Text1 
         BorderStyle     =   0  'None
         Height          =   1095
         Left            =   225
         Locked          =   -1  'True
         MultiLine       =   -1  'True
         TabIndex        =   23
         TabStop         =   0   'False
         Text            =   "frmDG.frx":036B
         Top             =   315
         Width           =   5715
      End
      Begin MSDataGridLib.DataGrid grdIATA 
         Height          =   1425
         Left            =   315
         TabIndex        =   39
         TabStop         =   0   'False
         ToolTipText     =   "To Delete a Box, highlight a row and press the Delete key."
         Top             =   4995
         Width           =   5610
         _ExtentX        =   9895
         _ExtentY        =   2514
         _Version        =   393216
         HeadLines       =   1
         RowHeight       =   15
         TabAction       =   2
         WrapCellPointer =   -1  'True
         AllowAddNew     =   -1  'True
         AllowDelete     =   -1  'True
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Caption         =   "Defined DG"
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Class:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   14
         Left            =   4800
         TabIndex        =   41
         Top             =   2400
         Width           =   1695
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Proper description:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   13
         Left            =   4710
         TabIndex        =   38
         Top             =   2040
         Width           =   1860
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Packing group:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   12
         Left            =   4755
         TabIndex        =   37
         Top             =   2760
         Width           =   1815
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Cargo only:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   11
         Left            =   4635
         TabIndex        =   36
         Top             =   3195
         Width           =   1935
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Packing instruction:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   10
         Left            =   4635
         TabIndex        =   35
         Top             =   3510
         Width           =   1935
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Unit of measure:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   9
         Left            =   4635
         TabIndex        =   34
         Top             =   4185
         Width           =   1935
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Quantity:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   8
         Left            =   6120
         TabIndex        =   33
         Top             =   4860
         Width           =   1605
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Packing type:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   7
         Left            =   4635
         TabIndex        =   32
         Top             =   3825
         Width           =   1935
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Number of units:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   6
         Left            =   6120
         TabIndex        =   31
         Top             =   5220
         Width           =   1605
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Title of signatory:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   5
         Left            =   135
         TabIndex        =   30
         Top             =   3285
         Width           =   1935
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Place of signatory:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   4
         Left            =   135
         TabIndex        =   29
         Top             =   2655
         Width           =   1935
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Count:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   3
         Left            =   6165
         TabIndex        =   28
         Top             =   4545
         Width           =   1605
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "U.N. Number:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   2
         Left            =   630
         TabIndex        =   27
         Top             =   4500
         Width           =   1530
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Emergency phone:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   1
         Left            =   135
         TabIndex        =   26
         Top             =   2970
         Width           =   1935
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Print form:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   0
         Left            =   3330
         TabIndex        =   25
         Top             =   1800
         Width           =   1125
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Name of signatory:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   23
         Left            =   135
         TabIndex        =   24
         Top             =   2355
         Width           =   1935
      End
      Begin VB.Line Line1 
         BorderColor     =   &H000080FF&
         BorderWidth     =   2
         Index           =   2
         X1              =   240
         X2              =   5880
         Y1              =   1560
         Y2              =   1560
      End
   End
End
Attribute VB_Name = "frmDG"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


' 2008-10-01, JFW, DG for Electrosonic.

Dim m_rsIATA As New ADODB.Recordset
Dim m_colDG As Collection
'


'---------------------------------------------------------------------------------------
' Procedure : AssignFormGlobalVars()
' DateTime  : 4/26/2006
' Purpose   : Assign the form's global vars
'---------------------------------------------------------------------------------------
'
Public Sub AssignFormGlobalVars()
    
    Dim c As Control
    
    If optADG Then
        g_str1331 = "A"
    ElseIf optIDG Then
        g_str1331 = "I"
    Else
        g_str1331 = ""
    End If
    
    g_clsReg.SetRegistryValue "Carry_f1331", g_str1331, REG_SZ
    For Each c In Me.Controls
        If TypeName(c) = "TextBox" Or TypeName(c) = "ComboBox" Then
            If c.name <> "Text1" Then
                g_clsReg.SetRegistryValue "Carry_" & c.name, c.Text, REG_SZ
            End If
        End If
    Next c

End Sub
'


'---------------------------------------------------------------------------------------
' Module    : BuildADGFlds
' DateTime  : 8/18/2005
' Author    : Chris Elwell
' Purpose   : Builds and returns fields required for IDG.
'---------------------------------------------------------------------------------------
'
Public Function BuildFields() As String
    
    On Error GoTo EH
    
    Dim strTrans As String
    
    TransactionBuilder strTrans, 1331, g_str1331                            'DG Flag
    TransactionBuilder strTrans, 1493, f1493.Text                               'DG Form Print Flag
    TransactionBuilder strTrans, 1918, f1918.Text                       'DG Name of Signatory
    TransactionBuilder strTrans, 1922, f1922.Text                  'DG Place of Signatory
    TransactionBuilder strTrans, 484, f484.Text                        'DG Emergency Phone #
    TransactionBuilder strTrans, 485, f485.Text                     'DG Title of Signatory
    TransactionBuilder strTrans, 1932, f1932.Text                               'DG Commodity Count
    TransactionBuilder strTrans, 451, f451.Text                              'DG UN #
    TransactionBuilder strTrans, 456, f456.Text                                 'DG Number of Units
    TransactionBuilder strTrans, 461, f461.Text                        'DG Packing Type
    TransactionBuilder strTrans, 466, f466.Text                               'DG Quantity
    TransactionBuilder strTrans, 471, f471.Text                                  'DG Unit of Measure
    TransactionBuilder strTrans, 476, f476.Text                              'DG Packing Instructions
    TransactionBuilder strTrans, 488, f488.Text                                  'DG Cargo Aircraft Only Field
    TransactionBuilder strTrans, 489, f489.Text                              'DG Packing Group
    TransactionBuilder strTrans, 492, f492.Text                              'DG Class
    TransactionBuilder strTrans, 1903, f1903.Text                            'DG Proper Shipping Name

    BuildFields = strTrans
    
    Exit Function
EH:
    MsgBox Err.Description, vbCritical, "frmDG:BuildFields"
    
End Function
'

Public Function BuildHazMatFlds() As String
    
    On Error GoTo EH
    Dim strTrans As String
    
    '20071016-02 Added Ha-Mat OP-900 fields. Still support label w/no OP-900
    TransactionBuilder strTrans, 1331, "Y"                                  'DG Flag
    TransactionBuilder strTrans, 1493, g_str1493                            'DG Form Print Flag
    TransactionBuilder strTrans, 484, g_str484                                                              'DG Emergency Phone #
    TransactionBuilder strTrans, 451, f451.Text                                     'DG UN #
    TransactionBuilder strTrans, 466, RemoveSpecial(ImpliedDecimal(f466.Text))   'DG Quantity
    TransactionBuilder strTrans, 471, f471.Text                               'DG Unit of Measure
    TransactionBuilder strTrans, 489, f489.Text                                'DG Packing Group
    TransactionBuilder strTrans, 492, f492.Text                                    'Haz Class
    TransactionBuilder strTrans, 1903, f1903.Text                'DG Proper Shipping Name
    TransactionBuilder strTrans, 3072, f3072.Text                                 'DG Proper Shipping Name
    
    BuildHazMatFlds = strTrans
    
    Exit Function
EH:
    MsgBox Err.Description, vbCritical, "frmDG:BuildHazMatFlds"
    
End Function
'


Private Sub SetFields()


End Sub
'

Private Sub cmdAdd_Click()
    
    Dim c As Control
    Dim colDGItem As New Collection
    Dim colTag As Collection
    
    If f451.Text <> "" Then
        If m_colDG Is Nothing Then Set m_colDG = New Collection
        listDG.AddItem f451.Text
        For Each c In Me.Controls
            If TypeName(c) = "TextBox" Or TypeName(c) = "ComboBox" Then
                Set colTag = New Collection
                colTag.Add Replace(c.name, "f", "")
                colTag.Add QuoteTrim(c.Text)
                colDGItem.Add colTag, c.name
            End If
        Next c
        m_colDG.Add colDGItem
    End If
    
End Sub

Private Sub cmdCancel_Click()
    Dim i As Long
    For i = 0 To 4
        frmShip.f1331(i).Value = 0
    Next i
    g_str1331 = ""
    Me.Hide
End Sub
'


Private Sub cmdRemove_Click()

    If listDG.ListIndex >= 0 Then
        m_colDG.Remove listDG.ListIndex + 1
        listDG.RemoveItem listDG.ListIndex
    End If
    
End Sub

Private Sub cmdSave_Click()
    Call AssignFormGlobalVars
    Me.Hide
End Sub

Private Sub f451_Validate(Cancel As Boolean)
    On Error GoTo EH
    Dim strMessage As String
    Dim strQuery As String
    Dim i As Long
    Dim boolPass As Boolean
    Dim boolCargo As Boolean
    
    If Not m_rsIATA Is Nothing Then
        If m_rsIATA.State = adStateOpen Then m_rsIATA.Close
        Set m_rsIATA = Nothing
        Set m_rsIATA = New ADODB.Recordset
    End If
    
    If f451.Text <> "" Then
        
        strQuery = "SELECT * FROM IATA WHERE DG_Num = '" & f451.Text & "'"
        m_rsIATA.Open strQuery, g_connFSMSClient, adOpenStatic, adLockOptimistic
        
        Do While Not m_rsIATA.EOF
                       
            strMessage = strMessage & IIf(strMessage <> "", vbCrLf, "") _
                & m_rsIATA!PROPER_SHIPPING_NAME
                
            If m_rsIATA!XRefFlag & "" <> "Y" Then
                f1903.Text = m_rsIATA!PROPER_SHIPPING_NAME & ""
                strMessage = strMessage & IIf(strMessage <> "", vbCrLf, "") _
                    & "Description:  " & m_rsIATA!Description
                f492.Text = m_rsIATA!ClassOrDivision & ""
                strMessage = strMessage & IIf(strMessage <> "", vbCrLf, "") _
                    & "Class:  " & m_rsIATA!ClassOrDivision
                strMessage = strMessage & IIf(strMessage <> "", vbCrLf, "") _
                    & "Spec:  " & m_rsIATA!spec_prov1
                
                If True Then
                    strMessage = strMessage & IIf(strMessage <> "", vbCrLf, "") _
                        & "Labels:  " & m_rsIATA!I_Lbl1
                End If
                If m_rsIATA!I_Lbl2 & "" <> "" Then
                    strMessage = strMessage & IIf(strMessage <> "", vbCrLf, "") _
                        & "         " & m_rsIATA!I_Lbl2
                End If
                If m_rsIATA!I_Lbl3 & "" <> "" Then
                    strMessage = strMessage & IIf(strMessage <> "", vbCrLf, "") _
                        & "         " & m_rsIATA!I_Lbl3
                End If
                
                strMessage = strMessage & IIf(strMessage <> "", vbCrLf, "") _
                    & m_rsIATA!ClassOrDivision
            
            End If
            
'            ' Packing group
'            For i = 1 To 3
'                If m_rsIATA(String(i, "I") & "_PkgGrpid").Value & "" <> "" Then _
'                    f489.AddItem m_rsIATA(String(i, "I") & "_PkgGrpid").Value & ""
'            Next i
'
'            ' Packing instr
'            For i = 1 To 3
'                If m_rsIATA(String(i, "I") & "_PassPkgInsr1").Value & "" <> "" Then
'                    f476.AddItem m_rsIATA(String(i, "I") & "_PassPkgInsr1").Value & ""
'                    boolPass = True
'                End If
'                If m_rsIATA(String(i, "I") & "_PassPkgInsr2").Value & "" <> "" Then
'                    f476.AddItem m_rsIATA(String(i, "I") & "_PassPkgInsr2").Value & ""
'                    boolPass = True
'                End If
'                If m_rsIATA(String(i, "I") & "_CargoPkgInsr").Value & "" <> "" Then
'                    f476.AddItem m_rsIATA(String(i, "I") & "_CargoPkgInsr").Value & ""
'                    boolCargo = True
'                End If
'            Next i
'
'            ' Packing type
'            For i = 1 To 3
'                If m_rsIATA(String(i, "I") & "_PassMaxNetQtyPerPack1").Value & "" <> "" Then _
'                    f461.AddItem m_rsIATA(String(i, "I") & "_PassMaxNetQtyPerPack1").Value & ""
'                If m_rsIATA(String(i, "I") & "_PassMaxNetQtyPerPack2").Value & "" <> "" Then _
'                    f461.AddItem m_rsIATA(String(i, "I") & "_PassMaxNetQtyPerPack2").Value & ""
'                If m_rsIATA(String(i, "I") & "_cargoMaxNetQtyPerPack").Value & "" <> "" Then _
'                    f461.AddItem m_rsIATA(String(i, "I") & "_cargoMaxNetQtyPerPack").Value & ""
'            Next i
            
            m_rsIATA.MoveNext
        Loop
        
        m_rsIATA.Close
        strQuery = "SELECT * FROM IATAPacking WHERE DG_Num = '" & f451.Text & "'"
        m_rsIATA.Open strQuery, g_connFSMSClient, adOpenStatic, adLockOptimistic
        
        With grdIATA
            Set .DataSource = m_rsIATA
            .ClearFields
            .ReBind
            .Columns(0).Width = 0
            .Columns(1).Width = .Columns(1).Width * 0.6
            .Columns(2).Width = .Columns(2).Width * 0.5
            .Columns(3).Width = .Columns(3).Width * 0.6
        End With
        
        f488.Clear
        f488.AddItem "N"
        f488.AddItem "Y"
        
        If strMessage <> "" Then
            frmMsgBox.ShowMessage strMessage, 30000
        Else
            frmMsgBox.ShowMessage "U.N. number not found.", 4000
        End If
    End If

Release:
    Exit Sub
    
EH:
    MsgBox Err.Description, vbCritical, "frmDG:f451_Validate"
    Resume Release
    Resume
End Sub
'




Private Sub Form_Load()
    On Error GoTo EH
    Dim strQuery As String
    Dim rs As New ADODB.Recordset
    Dim c As Control
    
    optADG = False
    optIDG = False
    
    strQuery = "SELECT DG_Num FROM IATA group by DG_Num order by DG_Num"
    rs.Open strQuery, g_connFSMSClient, adOpenStatic, adLockOptimistic
    f451.Clear
    Do While Not rs.EOF
        f451.AddItem rs("DG_Num")
        rs.MoveNext
    Loop
    
    For Each c In Me.Controls
        If TypeName(c) = "TextBox" Or TypeName(c) = "ComboBox" Then
            If c.name <> "Text1" Then
                c.Text = g_clsReg.GetRegistryValue("Carry_" & c.name, "")
            End If
        End If
    Next c
    If g_clsReg.GetRegistryValue("Carry_f1331", "") = "A" Then
        optADG.Value = 1
    End If
    If g_clsReg.GetRegistryValue("Carry_f1331", "") = "I" Then
        optIDG.Value = 1
    End If
    
Release:
    If rs.State = adStateOpen Then rs.Close
    Set rs = Nothing
    Exit Sub

EH:
    MsgBox Err.Description, vbCritical, "frmDG:Form_Load"
    Resume Release
    Resume
End Sub
'

Private Sub grdIATA_DblClick()

    If grdIATA.Row >= 0 Then
        f492.Text = grdIATA.Columns("PkgGrpid")
        f489.Text = grdIATA.Columns("PkgGrpid")
        f488.Text = IIf(grdIATA.Columns("PC") = "Cargo", "Y", "N")
        f476.Text = grdIATA.Columns("PkgInsr")
        f461.Text = grdIATA.Columns("MaxNetQtyPerPack")
    End If

End Sub

Private Sub optADG_Click()

    g_str1331 = "A"
    
End Sub

Private Sub optIDG_Click()

    g_str1331 = "I"
    
End Sub

